<h4>
  {{type | upperFirst}} Hook
  <span ng-switch="type">
    <small ng-switch-when="pre">&ndash; runs before the deployment begins</small>
    <small ng-switch-when="mid">&ndash; runs after the previous deployment is scaled down to zero and before the first pod of the new deployment is created</small>
    <small ng-switch-when="post">&ndash; runs after the deployment strategy completes</small>
  </span>
</h4>
<dl class="dl-horizontal left">
  <dt>Action:</dt>
  <dd>{{strategyParams[type].execNewPod ? "Run a command" : "Tag the image"}}</dd>
  <dt>Failure Policy:</dt>
  <dd>{{strategyParams[type].failurePolicy}}
    <span class="help action-inline">
      <a href ng-switch="strategyParams[type].failurePolicy">
        <i ng-switch-when="Ignore" class="pficon pficon-help" data-toggle="tooltip" aria-hidden="true" data-original-title="Continue with deployment on failure"></i>
        <i ng-switch-when="Abort" class="pficon pficon-help" data-toggle="tooltip" aria-hidden="true" data-original-title="Abort deployment on failure"></i>
        <i ng-switch-when="Retry" class="pficon pficon-help" data-toggle="tooltip" aria-hidden="true" data-original-title="Retry the hook until it succeeds"></i>
      </a>
    </span>
  </dd>
  <div ng-if="strategyParams[type].execNewPod">
    <h5 class="container-name">Container {{strategyParams[type].execNewPod.containerName}}</h5>
    <dl class="dl-horizontal left">
      <dt>Command:</dt>
      <dd>
        <code class="command">
          <span ng-repeat="arg in strategyParams[type].execNewPod.command">
            <truncate-long-text content="arg" limit="80" newline-limit="1" expandable="false" use-word-boundary="false"></truncate-long-text>
          </span>
        </code>
      </dd>
      <dt ng-if-start="strategyParams[type].execNewPod.env">Environment Variables:</dt>
      <dd ng-if-end>
        <div ng-repeat="env in strategyParams[type].execNewPod.env">
          <div ng-if="env.valueFrom.configMapKeyRef || env.valueFrom.secretKeyRef">
            {{env.name}} set to key
            <span ng-if="env.valueFrom.configMapKeyRef">
              {{env.valueFrom.configMapKeyRef.key}} in config map
              <span
                ng-if="!(configMapsVersion | canI : 'get')">
                {{env.valueFrom.configMapKeyRef.name}}
              </span>
              <a
                ng-if="configMapsVersion | canI : 'get'"
                ng-href="{{env.valueFrom.configMapKeyRef.name | navigateResourceURL : 'ConfigMap' : deploymentConfig.metadata.namespace}}">
                {{env.valueFrom.configMapKeyRef.name}}
              </a>
            </span>
            <span ng-if="env.valueFrom.secretKeyRef">
              {{env.valueFrom.secretKeyRef.key}} in secret
              <span
                ng-if="!(secretsVersion | canI : 'get')">
                {{env.valueFrom.secretKeyRef.name}}
              </span>
              <a
                ng-if="secretsVersion | canI : 'get'"
                ng-href="{{env.valueFrom.secretKeyRef.name | navigateResourceURL : 'Secret' : deploymentConfig.metadata.namespace}}">
                {{env.valueFrom.secretKeyRef.name}}
              </a>
            </span>
          </div>
          <div ng-if="!env.valueFrom" class="truncate" ng-attr-title="{{env.value}}">
            {{env.name}}={{env.value}}
          </div>
        </div>
      </dd>
      <dt ng-if-start="strategyParams[type].execNewPod.volumes">Volumes:</dt>
      <dd ng-if-end>
        <div ng-repeat="volume in strategyParams[type].execNewPod.volumes">
          {{volume}}
        </div>
      </dd>
    </dl>
  </div>
  <div ng-if="strategyParams[type].tagImages">
    <div ng-repeat="tagImage in strategyParams[type].tagImages">
    <h5 class="container-name">Container {{tagImage.containerName}}</h5>
      <dl class="dl-horizontal left">
        <div>Tag image as <a ng-if="!tagImage.to.namespace || tagImage.to.namespace === deploymentConfig.metadata.namespace" ng-href="{{tagImage.to.name | navigateResourceURL : 'ImageStreamTag' : deploymentConfig.metadata.namespace}}">{{tagImage.to | imageObjectRef : deploymentConfig.metadata.namespace}}</a>
          <span ng-if="tagImage.to.namespace && tagImage.to.namespace !== deploymentConfig.metadata.namespace">{{tagImage.to | imageObjectRef : deploymentConfig.metadata.namespace}}</span></div>
      </dl>
    </div>
  </div>
</dl>
